package app.caihan.wanandroid.model.api

import app.caihan.wanandroid.base.AppInfo
import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

/**
 *
 *
 * @author Seven-C
 * @date 2020/8/24
 */
class MyHeadInterceptor : Interceptor {

    @Throws(IOException::class)
    override fun intercept(chain: Interceptor.Chain): Response {
        val builder = chain.request().newBuilder()
        builder.addHeader("token", "token123456").build()
        builder.addHeader("device", "Android").build()
        builder.addHeader("isLogin", AppInfo.isLogin().toString()).build()
        return chain.proceed(builder.build())
    }

}